<template>
  <div class="tucao">
    <h1>吐槽吧</h1>
    <el-form :model="form" style="max-width: 600px">
      <el-form-item>
        <el-input v-model="form.desc" type="textarea" />
      </el-form-item>

      <el-form-item >
        <div class="mydiv flex h-center">
          <el-button type="primary" @click="onSubmit">提交</el-button>
        </div>
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup>
import { reactive } from 'vue'
import { ElMessage } from 'element-plus'

const form = reactive({
  name: '',
  region: '',
  date1: '',
  date2: '',
  delivery: false,
  type: [],
  resource: '',
  desc: '',
})

const onSubmit = () => {
  if(form.desc === '') {
    ElMessage('请输入内容')
    return;
  }

  form.desc = '';
  ElMessage('提交成功!')
}

</script>

<style>
@media (min-width: 1024px) {
  .tucao {
    min-height: 100vh;
    display: flex;
    align-items: center;
  }
}

.mydiv {
  width: 100%;
}

</style>
